/* PUS - Predictive UDP Scanner

BUGS AND LIMITATIONS

Please refer to the comments beginning with "TODO" in the Code.

AUTHOR

Christian Heinrich

CONTACT INFORMATION

christian.heinrich@owasp.org
christian.heinrich@cmlh.id.au
cmlh@cpan.org

http://www.linkedin.com/in/ChristianHeinrich

FURTHER INFORMATION AND UPDATES

http://del.icio.us/cmlh/

LICENSE AND COPYRIGHT

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

COMMENTS

I took your advice and technically have more code than disclaimer,
in this program, although now you will complain that it is mainly
ascii art. I have kept to the childish theme of previous releases
(dic and tit) and called this one pus, but I'll let the ascii art
do the talking.

Copyright 2010 Christian Heinrich */



#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main()
{
	char domain[30] = "";
	char str0[] = "ns.";
	char str1[] = "ns1.";
	char str2[] = "ns2.";
	char str3[] = "ns3.";
	char str4[] = "dns.";
	char str5[] = "goatse.cx";
	char str6[] = "cmlh";


/* TODO Write some decent code that actually does something. */
	printf("\n\
      ooooooooo    ooooo     ooo   oooooo  o\n\
       888    Y88   888       8  d8P      Y8\n\
       888    d88   888       8  Y88bo      \n\
       888ooo88P    888       8     Y8888o  \n\
       888          888       8         Y88b\n\
       888           88      88  oo      d8P\n\
      o888o            YbodP     8 888888P  \n\
\n\
     M:::::M:::::::::::::::::::::::MMM::::::::M:::M\n\
    M:::::Mm::::::::::::::::::::::MMM:::::::::M::::M\n\
   MM::::Mm:::::::::::::::::::::MMMM:::::::::m::m:::M\n\
   M:::::M::::::::::::::::::::MMM::::::::::::M::mm:::M\n\
  MM:::::::::::::::::::::::::MM:::::::::::::mM::MM:::M:\n\
  M:::::::::::::::::::::::::M:::::::::::::::mM::MM:::Mm\n\
 MM::::::m:::::::::::::::::::::::::::::::::::M::MM:::MM\n\
 M::::::::M:::::::::::::::::::::::::::::::::::M::M:::MM\n\
 MM:::::::::M:::::::::::::M:::::::::::::::::::::M:M:::MM\n\
M:::::::::::M88:::::::::M:::::::::::::::::::::::MM::MMM\n\
M::::::::::::8888888888M::::::::::::::::::::::::MM::MM\n\
M:::::::::::::88888888M:::::::::::::::::::::::::M::MM\n\
M::::::::::::::888888M:::::::::::::::::::::::::M::MM\n\
M:::::::::::::::88888M:::::::::::::::::::::::::M:MM\n\
M:::::::::::::::::88M::::::::::::::::::::::::::MMM\n\
M:::::::::::::::::::M::::::::::::::::::::::::::MMM\n\
MM:::::::::::::::::M::::::::::::::::::::::::::MMM\n\
 M:::::::::::::::::M::::::::::::::::::::::::::MMM\n\
 MM:::::::::::::::M::::::::::::::::::::::::::MMM\n\
  M:::::::::::::::M:::::::::::::::::::::::::MMM\n\n");


	printf("Input the hostname for PUS to scan predictively: ");
	scanf("%s", domain);


	if
          (strstr(domain, str0) == NULL)
          printf(".");
        else {
          printf("\n\"%s\" was found in \"%s\" so I predict UDP port 53 is open\n", str0, domain);
          exit(0);
        }
	
	if
	  (strstr(domain, str1) == NULL)
	  printf(".");
	else {
	  printf("\n\"%s\" was found in \"%s\" so I predict UDP port 53 is open\n", str1, domain);
	  exit(0);
	}
	
	if
	  (strstr(domain, str2) == NULL)
          printf(".");
	else {
          printf("\n\"%s\" was found in \"%s\" so I predict UDP port 53 is open\n", str2, domain);
          exit(0);
        }

	if
	  (strstr(domain, str3) == NULL)
          printf(".");
	else {
          printf("\n\"%s\" was found in \"%s\" so I predict UDP port 53 is open\n", str3, domain);
          exit(0);
        }
	
	if
	  (strstr(domain, str4) == NULL)
          printf(".");
	else {
          printf("\n\"%s\" was found in \"%s\" so I predict UDP port 53 is open\n", str4, domain);
          exit(0);
        }

	if
          (strstr(domain, str5) == NULL)
          printf(".");
        else {
          printf("\n\"%s\" was found in \"%s\" so I predict my Back Orifice is open.\nCome and probe me you big giver!\n", str5, domain);
          exit(0);
        }

	if
          (strstr(domain, str6) == NULL)
          printf(".");
        else {
          printf("\n\"%s\" was found in \"%s\" so this website must belong to the fake cmlh.\n\nI'm starting my next world speaking tour soon based on this piece of C code.\nLook for me at the next international conference, because everyone in AU thinks \nI'm lame for some reason. I don't know why.\n\n", str6, domain);
          exit(0);
        }	
	return 0;
}
